# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bash-completion
pkgver=2.10
pkgrel=1
pkgdesc="Programmable completion for the bash shell"
arch=('any')
url="https://bash-completion.alioth.debian.org/"
license=('GPL')
groups=('base')
depends=('bash')
options=('!emptydirs' '!makeflags')
source=(https://github.com/scop/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz
        001-quote_readline_by_ref_fixes.patch)
sha256sums=('123c17998e34b937ce57bb1b111cd817bc369309e9a8047c0bcf06ead4a3ec92'
            'cb33b656f435b945a6ae42dace5ace56e7063152ad3fa38429a7311d491525af')
prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/001-quote_readline_by_ref_fixes.patch

  autoreconf --install
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install

  rm "${pkgdir}"/usr/share/bash-completion/completions/makepkg
}
